import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '店铺名称',
    align:"center",
    dataIndex: 'shopName'
   },
   {
    title: '原始单号',
    align:"center",
    dataIndex: 'originalNo'
   },
   {
    title: '收件人',
    align:"center",
    dataIndex: 'receiver'
   },
   {
    title: '手机',
    align:"center",
    dataIndex: 'mobile'
   },
   {
    title: '省',
    align:"center",
    dataIndex: 'province'
   },
   {
    title: '市',
    align:"center",
    dataIndex: 'city'
   },
   {
    title: '区',
    align:"center",
    dataIndex: 'district'
   },
   {
    title: '详细地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '邮费',
    align:"center",
    dataIndex: 'postage'
   },
   {
    title: '商家编码',
    align:"center",
    dataIndex: 'merchantCode'
   },
   {
    title: '平台货品名称',
    align:"center",
    dataIndex: 'platformName'
   },
   {
    title: '货品数量',
    align:"center",
    dataIndex: 'goodsQuantity'
   },
   {
    title: '货品单价',
    align:"center",
    dataIndex: 'goodsPrice'
   },
   {
    title: '货品总价',
    align:"center",
    dataIndex: 'goodsTotal'
   },
   {
    title: '客服备注',
    align:"center",
    dataIndex: 'serviceRemark'
   },
   {
    title: '发货条件',
    align:"center",
    dataIndex: 'deliverTerm'
   },
   {
    title: '应收合计',
    align:"center",
    dataIndex: 'receivable'
   },
   {
    title: '优惠金额',
    align:"center",
    dataIndex: 'discount'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "店铺名称",
      field: 'shopName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "原始单号",
      field: 'originalNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '店铺名称',
    field: 'shopName',
    component: 'Input',
  },
  {
    label: '原始单号',
    field: 'originalNo',
    component: 'Input',
  },
  {
    label: '收件人',
    field: 'receiver',
    component: 'Input',
  },
  {
    label: '手机',
    field: 'mobile',
    component: 'Input',
  },
  {
    label: '省',
    field: 'province',
    component: 'Input',
  },
  {
    label: '市',
    field: 'city',
    component: 'Input',
  },
  {
    label: '区',
    field: 'district',
    component: 'Input',
  },
  {
    label: '详细地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '邮费',
    field: 'postage',
    component: 'InputNumber',
  },
  {
    label: '商家编码',
    field: 'merchantCode',
    component: 'Input',
  },
  {
    label: '平台货品名称',
    field: 'platformName',
    component: 'Input',
  },
  {
    label: '货品数量',
    field: 'goodsQuantity',
    component: 'Input',
  },
  {
    label: '货品单价',
    field: 'goodsPrice',
    component: 'InputNumber',
  },
  {
    label: '货品总价',
    field: 'goodsTotal',
    component: 'InputNumber',
  },
  {
    label: '客服备注',
    field: 'serviceRemark',
    component: 'Input',
  },
  {
    label: '发货条件',
    field: 'deliverTerm',
    component: 'Input',
  },
  {
    label: '应收合计',
    field: 'receivable',
    component: 'InputNumber',
  },
  {
    label: '优惠金额',
    field: 'discount',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  shopName: {title: '店铺名称',order: 0,view: 'text', type: 'string',},
  originalNo: {title: '原始单号',order: 1,view: 'text', type: 'string',},
  receiver: {title: '收件人',order: 2,view: 'text', type: 'string',},
  mobile: {title: '手机',order: 3,view: 'text', type: 'string',},
  province: {title: '省',order: 4,view: 'text', type: 'string',},
  city: {title: '市',order: 5,view: 'text', type: 'string',},
  district: {title: '区',order: 6,view: 'text', type: 'string',},
  address: {title: '详细地址',order: 7,view: 'text', type: 'string',},
  postage: {title: '邮费',order: 8,view: 'number', type: 'number',},
  merchantCode: {title: '商家编码',order: 9,view: 'text', type: 'string',},
  platformName: {title: '平台货品名称',order: 10,view: 'text', type: 'string',},
  goodsQuantity: {title: '货品数量',order: 11,view: 'text', type: 'string',},
  goodsPrice: {title: '货品单价',order: 12,view: 'number', type: 'number',},
  goodsTotal: {title: '货品总价',order: 13,view: 'number', type: 'number',},
  serviceRemark: {title: '客服备注',order: 14,view: 'text', type: 'string',},
  deliverTerm: {title: '发货条件',order: 15,view: 'text', type: 'string',},
  receivable: {title: '应收合计',order: 16,view: 'number', type: 'number',},
  discount: {title: '优惠金额',order: 17,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}